package com.demo.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.RelativeLayout;

import androidx.annotation.DrawableRes;
import androidx.annotation.Nullable;


/**
 * Describe:
 * Created by Rance Rang on 2019-12-21.
 * <p>
 * Copyright (c) Tange.Inc All rights reserved.
 */
public class PtzView extends RelativeLayout {
    protected OnPtzControlTouchListener onPtzControlTouchListener;

    protected boolean isSendPTZCmd = false;
    protected int ptzCmd = -1;
    protected boolean mIsLandscape;

    public static final int AVIOCTRL_PTZ_STOP = 0;
    public static final int AVIOCTRL_PTZ_UP = 1;
    public static final int AVIOCTRL_PTZ_DOWN = 2;
    public static final int AVIOCTRL_PTZ_LEFT = 3;
    public static final int AVIOCTRL_PTZ_RIGHT = 6;

    public void setLandscape(boolean landscape) {
        mIsLandscape = landscape;
        showArrow(!mIsLandscape);
    }

    public void setSendPTZCmd(boolean sendPTZCmd) {
        isSendPTZCmd = sendPTZCmd;
    }

    public void setImageView(@DrawableRes int resId) {
    }

    private void showArrow(boolean show) {

    }

    public void setOnPtzControlTouchListener(OnPtzControlTouchListener onPtzControlTouchListener) {
        this.onPtzControlTouchListener = onPtzControlTouchListener;
    }


    public PtzView(Context context) {
        super(context);
    }

    public PtzView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }



    public PtzView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }



    public interface OnPtzControlTouchListener {
        void onShortCmd(int control);

        void onStopCmd();

        void onLongCmd(int control);
    }
}
